import { createRouter, createWebHistory } from 'vue-router'

import LoginView from '../views/LoginView.vue'
import Registration from '../views/RegistrationView.vue'
import MainView from '../views/MainView.vue'
import Whelcome from '../views/WhelcomeView.vue'
import User_setting from '../views/UserSettingsView.vue'
import about from '../views/AboutView.vue'
import reset_pwd from '../views/ResetPwdView.vue'

const routes = [
  {
    path: '/',
    name: 'main',
    component: MainView,
    children: [
      {
        path: '/whelcome',
        name: 'whelcome',
        component: Whelcome
      },
      {
        path: '/user_settings',
        name: 'User_setting',
        component: User_setting,
      },
      {
        path: '/Content_Ma',
        name: 'Content_Ma',
        component: () => import('../views/Content_MaView.vue'),
      },
      {
        path: '/hair_community',
        name: 'hair_community',
        component: () => import('../views/Hair_communityView.vue'),
      },
      {
        path: '/community_dynamic',
        name: 'community_dynamic',
        component: () => import('../views/CommunitydynamicView.vue'),
      },
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: LoginView
  },
  {
    path: '/registration',
    name: 'registration',
    component: Registration
  },
  { 
    path: '/reset_pwd',
    component: reset_pwd
  }
  
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
